package ca.tatham.senssim.diffusion;

import java.io.IOException;

import org.apache.commons.cli.ParseException;

import ca.tatham.senssim.SensSimOptions;
import ca.tatham.senssim.Simulation;
import ca.tatham.senssim.util.Address;

public class SimulationDirectedDiffusion extends Simulation
{

  @Override
  protected AbstractDiffusionNode createSimpleNode(Address address, int power)
  {
    return new SimpleDiffusionNode(address, power);
  }

  @Override
  protected AbstractDiffusionNode createSensorNode(Address address, int power)
  {
    return new SensorNodeDirectedDiffusion(address, power);
  }

  @Override
  protected AbstractDiffusionNode createSinkNode(Address address)
  {
    return new SinkNodeDirectedDiffusion(address);
  }

  @Override
  protected AbstractDiffusionNode[][] createGrid(int gridSize)
  {
    return new AbstractDiffusionNode[gridSize][gridSize];
  }

  public static void main(String[] args) throws ParseException, IOException
  {
    SensSimOptions options = new SensSimOptions();
    options.parse(args);
    Simulation sim = new SimulationDirectedDiffusion();
    sim.suite(options, "dd.csv");
  }

}
